import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',

    name: 'Login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/layout',
    name: 'Layout',
    component: () => import('@/views/Layout.vue'),
    children: [
      {
        path: '/dashboard',
        name: 'Dashboard',
        component: () => import('@/views/Dashboard.vue')
      },
      {
        path: '/user/list',
        name: 'UserList',
        component: () => import('@/views/user/UserList.vue')
      },
      {
        path: '/room/type',
        name: 'RoomType',
        component: () => import('@/views/room/RoomType.vue')
      },
      {
        path: '/room/list',
        name: 'RoomList',
        component: () => import('@/views/room/RoomList.vue')
      },
      {
        path: '/reservation/list',
        name: 'ReservationList',
        component: () => import('@/views/reservation/ReservationList.vue')
      },
      {
        path: '/checkin/list',
        name: 'CheckInList',
        component: () => import('@/views/checkin/CheckInList.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router